package com.smart.manager.union.mall.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.common.entities.domain.OrderAddress;
import com.smart.manager.member.entities.views.MemberView;
import com.smart.manager.union.egg.enums.EggOrderState;
import com.smart.manager.union.mall.enums.MallOrderState;
import io.ebean.annotation.DbJson;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * 狼山鸡蛋配置信息
 *
 * @author leo
 * @date 2023/07/26
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Accessors(chain = true)
@Data
public class UnionMallOrder extends BaseLongModel {



    @ApiModelProperty("会员信息")
    @ManyToOne
    @JoinColumn(name = "member" ,referencedColumnName = "id")
    private MemberView member;


    @ApiModelProperty("商品Id")
    @ManyToOne
    @JoinColumn(name = "goods" ,referencedColumnName = "id")
    private UnionMallGoods goods;




    @ApiModelProperty("购买数量")
    private Integer quantity;


    @ApiModelProperty("收货地址")
    @DbJson
    private OrderAddress address;


    @ApiModelProperty("快递名称")
    private String expressName;

    @ApiModelProperty("快递单号")
    private String expressCode;

    @ApiModelProperty("快递费用")
    private BigDecimal expressFee;

    @ApiModelProperty("订单状态")
    private MallOrderState state;

    @ApiModelProperty("订单发货时间")
    private LocalDateTime sendTime;


    @ApiModelProperty("订单提交时间")
    private LocalDateTime submitTime;


}
